home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17619 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 71 75 | 6f 69 6e 31 2e 71 75 6f |Path: qu|oin1.quo|
|00000010| 69 6e 69 6e 63 2e 63 6f | 6d 21 6a 70 6c 65 6a 61 |ininc.co|m!jpleja|
|00000020| 63 71 0a 46 72 6f 6d 3a | 20 4a 65 61 6e 20 50 69 |cq.From:| Jean Pi|
|00000030| 65 72 72 65 20 4c 65 4a | 61 63 71 20 3c 6a 70 6c |erre LeJ|acq <jpl|
|00000040| 65 6a 61 63 71 40 71 75 | 6f 69 6e 69 6e 63 2e 63 |ejacq@qu|oininc.c|
|00000050| 6f 6d 3e 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |om>.News|groups: |
|00000060| 63 6f 6d 70 2e 6c 61 6e | 67 2e 63 2b 2b 0a 53 75 |comp.lan|g.c++.Su|
|00000070| 62 6a 65 63 74 3a 20 52 | 65 3a 20 43 2b 2b 20 63 |bject: R|e: C++ c|
|00000080| 6f 6d 70 6c 65 78 20 6e | 75 6d 62 65 72 73 20 73 |omplex n|umbers s|
|00000090| 6c 6f 77 20 61 73 20 6d | 6f 6c 61 73 73 65 73 3f |low as m|olasses?|
|000000a0| 0a 44 61 74 65 3a 20 54 | 75 65 2c 20 31 36 20 41 |.Date: T|ue, 16 A|
|000000b0| 70 72 20 31 39 39 36 20 | 31 33 3a 31 34 3a 32 34 |pr 1996 |13:14:24|
|000000c0| 20 2d 30 34 30 30 0a 4f | 72 67 61 6e 69 7a 61 74 | -0400.O|rganizat|
|000000d0| 69 6f 6e 3a 20 51 75 6f | 69 6e 20 49 6e 63 20 2d |ion: Quo|in Inc -|
|000000e0| 20 43 61 6d 62 72 69 64 | 67 65 2c 20 4d 41 2c 20 | Cambrid|ge, MA, |
|000000f0| 55 53 41 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |USA.Mess|age-ID: |
|00000100| 3c 50 69 6e 65 2e 4c 4e | 58 2e 33 2e 39 31 2e 39 |<Pine.LN|X.3.91.9|
|00000110| 36 30 34 31 36 31 33 30 | 39 31 31 2e 38 37 32 44 |60416130|911.872D|
|00000120| 2d 31 30 30 30 30 30 40 | 71 75 6f 69 6e 31 2e 71 |-100000@|quoin1.q|
|00000130| 75 6f 69 6e 69 6e 63 2e | 63 6f 6d 3e 0a 52 65 66 |uoininc.|com>.Ref|
|00000140| 65 72 65 6e 63 65 73 3a | 20 3c 34 6b 36 6b 38 63 |erences:| <4k6k8c|
|00000150| 24 38 68 34 40 6e 79 78 | 2e 63 73 2e 64 75 2e 65 |$8h4@nyx|.cs.du.e|
|00000160| 64 75 3e 20 3c 39 36 30 | 34 30 37 31 38 35 31 2e |du> <960|4071851.|
|00000170| 41 41 30 30 31 6f 31 40 | 6c 6f 72 65 6c 65 69 2e |AA001o1@|lorelei.|
|00000180| 64 65 6d 6f 6e 2e 63 6f | 2e 75 6b 3e 20 3c 34 6b |demon.co|.uk> <4k|
|00000190| 65 35 61 70 24 62 38 62 | 40 6d 61 67 31 2e 6d 61 |e5ap$b8b|@mag1.ma|
|000001a0| 67 6d 61 63 6f 6d 2e 63 | 6f 6d 3e 20 3c 50 69 6e |gmacom.c|om> <Pin|
|000001b0| 65 2e 4c 4e 58 2e 33 2e | 39 31 2e 39 36 30 34 31 |e.LNX.3.|91.96041|
|000001c0| 32 30 37 33 39 34 33 2e | 33 30 38 45 2d 31 30 30 |2073943.|308E-100|
|000001d0| 30 30 30 40 71 75 6f 69 | 6e 31 2e 71 75 6f 69 6e |000@quoi|n1.quoin|
|000001e0| 69 6e 63 2e 63 6f 6d 3e | 20 3c 34 6b 74 6b 69 37 |inc.com>| <4ktki7|
|000001f0| 24 76 66 74 40 6d 61 67 | 31 2e 6d 61 67 6d 61 63 |$vft@mag|1.magmac|
|00000200| 6f 6d 2e 63 6f 6d 3e 0a | 4e 4e 54 50 2d 50 6f 73 |om.com>.|NNTP-Pos|
|00000210| 74 69 6e 67 2d 48 6f 73 | 74 3a 20 71 75 6f 69 6e |ting-Hos|t: quoin|
|00000220| 31 2e 71 75 6f 69 6e 69 | 6e 63 2e 63 6f 6d 0a 4d |1.quoini|nc.com.M|
|00000230| 69 6d 65 2d 56 65 72 73 | 69 6f 6e 3a 20 31 2e 30 |ime-Vers|ion: 1.0|
|00000240| 0a 43 6f 6e 74 65 6e 74 | 2d 54 79 70 65 3a 20 54 |.Content|-Type: T|
|00000250| 45 58 54 2f 50 4c 41 49 | 4e 3b 20 63 68 61 72 73 |EXT/PLAI|N; chars|
|00000260| 65 74 3d 55 53 2d 41 53 | 43 49 49 0a 49 6e 2d 52 |et=US-AS|CII.In-R|
|00000270| 65 70 6c 79 2d 54 6f 3a | 20 3c 34 6b 74 6b 69 37 |eply-To:| <4ktki7|
|00000280| 24 76 66 74 40 6d 61 67 | 31 2e 6d 61 67 6d 61 63 |$vft@mag|1.magmac|
|00000290| 6f 6d 2e 63 6f 6d 3e 20 | 0a 0a 4f 6e 20 31 35 20 |om.com> |..On 15 |
|000002a0| 41 70 72 20 31 39 39 36 | 2c 20 41 63 6d 65 20 49 |Apr 1996|, Acme I|
|000002b0| 6e 73 74 61 6e 74 20 44 | 65 68 79 64 72 61 74 65 |nstant D|ehydrate|
|000002c0| 64 20 42 6f 75 6c 64 65 | 72 20 4b 69 74 20 77 72 |d Boulde|r Kit wr|
|000002d0| 6f 74 65 3a 0a 0a 3e 20 | 3e 66 75 6e 63 74 69 6f |ote:..> |>functio|
|000002e0| 6e 73 20 61 73 20 65 69 | 74 68 65 72 20 72 65 66 |ns as ei|ther ref|
|000002f0| 65 72 65 6e 63 65 64 20 | 6f 72 20 76 61 6c 75 65 |erenced |or value|
|00000300| 20 62 61 73 65 64 2e 20 | 20 4f 4f 20 6c 61 6e 67 | based. | OO lang|
|00000310| 75 61 67 65 73 20 61 72 | 65 0a 3e 20 3e 6d 6f 72 |uages ar|e.> >mor|
|00000320| 65 20 65 66 66 69 63 69 | 65 6e 74 20 6d 61 6e 69 |e effici|ent mani|
|00000330| 70 75 6c 61 74 69 6e 67 | 20 65 78 69 73 74 69 6e |pulating| existin|
|00000340| 67 20 6f 62 6a 65 63 74 | 73 20 28 72 65 66 65 72 |g object|s (refer|
|00000350| 65 6e 63 65 64 20 62 61 | 73 65 64 29 0a 3e 20 3e |enced ba|sed).> >|
|00000360| 74 68 61 6e 20 63 72 65 | 61 74 69 6e 67 20 6e 65 |than cre|ating ne|
|00000370| 77 20 6f 6e 65 20 28 76 | 61 6c 75 65 20 62 61 73 |w one (v|alue bas|
|00000380| 65 64 29 2e 20 20 46 6f | 72 74 75 6e 61 74 65 6c |ed). Fo|rtunatel|
|00000390| 79 2c 20 43 2b 2b 20 70 | 72 6f 76 69 64 65 73 0a |y, C++ p|rovides.|
|000003a0| 3e 20 3e 0a 3e 20 3e 63 | 6c 61 73 73 20 63 6f 6d |> >.> >c|lass com|
|000003b0| 70 6c 65 78 20 7b 0a 3e | 20 3e 20 20 20 70 75 62 |plex {.>| > pub|
|000003c0| 6c 69 63 3a 0a 3e 20 3e | 20 20 20 20 20 20 63 6f |lic:.> >| co|
|000003d0| 6d 70 6c 65 78 20 26 20 | 6f 70 65 72 61 74 6f 72 |mplex & |operator|
|000003e0| 20 2b 3d 28 63 6f 6d 70 | 6c 65 78 20 63 6f 6e 73 | +=(comp|lex cons|
|000003f0| 74 20 26 20 6c 68 73 29 | 3b 0a 3e 20 3e 7d 3b 0a |t & lhs)|;.> >};.|
|00000400| 3e 20 0a 3e 20 54 68 65 | 20 63 68 6f 69 63 65 73 |> .> The| choices|
|00000410| 20 61 72 65 3a 0a 3e 20 | 0a 3e 20 49 66 20 79 6f | are:.> |.> If yo|
|00000420| 75 20 75 73 65 20 74 68 | 65 20 2b 3d 2c 20 79 6f |u use th|e +=, yo|
|00000430| 75 20 6d 75 73 74 20 66 | 69 72 73 74 20 69 6e 69 |u must f|irst ini|
|00000440| 74 69 61 6c 69 7a 65 20 | 74 68 65 20 64 65 73 74 |tialize |the dest|
|00000450| 69 6e 61 74 69 6f 6e 20 | 65 78 70 6c 69 63 69 74 |ination |explicit|
|00000460| 6c 79 2c 20 61 6e 64 0a | 3e 20 74 68 65 6e 20 63 |ly, and.|> then c|
|00000470| 61 6c 6c 20 69 74 20 74 | 77 69 63 65 20 74 6f 20 |all it t|wice to |
|00000480| 61 63 68 69 65 76 65 20 | 74 68 65 20 73 61 6d 65 |achieve |the same|
|00000490| 20 66 75 6e 63 74 69 6f | 6e 61 6c 69 74 79 20 61 | functio|nality a|
|000004a0| 73 20 6f 6e 65 20 63 61 | 6c 6c 20 74 6f 20 74 68 |s one ca|ll to th|
|000004b0| 65 0a 3e 20 62 69 6e 61 | 72 79 20 6f 70 65 72 61 |e.> bina|ry opera|
|000004c0| 74 6f 72 2b 20 0a 0a 54 | 68 65 20 66 69 72 73 74 |tor+ ..T|he first|
|000004d0| 20 69 73 20 68 61 6e 64 | 6c 65 64 20 62 79 20 69 | is hand|led by i|
|000004e0| 6e 69 74 69 61 6c 69 7a | 61 74 69 6f 6e 20 77 68 |nitializ|ation wh|
|000004f0| 69 63 68 20 6d 75 73 74 | 20 62 65 20 64 6f 6e 65 |ich must| be done|
|00000500| 20 69 6e 20 61 6c 6c 0a | 63 61 73 65 73 2e 0a 0a | in all.|cases...|
|00000510| 3e 20 4f 72 2c 20 79 6f | 75 20 63 61 6e 20 6d 61 |> Or, yo|u can ma|
|00000520| 6b 65 20 6f 6e 65 20 63 | 61 6c 6c 20 74 6f 20 61 |ke one c|all to a|
|00000530| 20 32 2d 6f 70 65 72 61 | 6e 64 20 6d 65 6d 62 65 | 2-opera|nd membe|
|00000540| 72 20 66 75 6e 63 74 69 | 6f 6e 2e 20 53 6f 6d 65 |r functi|on. Some|
|00000550| 20 70 65 6f 70 6c 65 20 | 6c 69 6b 65 0a 3e 20 75 | people |like.> u|
|00000560| 73 69 6e 67 20 74 68 65 | 20 2b 3d 20 69 6e 20 70 |sing the| += in p|
|00000570| 6c 61 63 65 20 6f 66 20 | 74 68 65 20 2b 2c 20 6f |lace of |the +, o|
|00000580| 74 68 65 72 73 20 77 6f | 75 6c 64 20 72 61 74 68 |thers wo|uld rath|
|00000590| 65 72 20 61 63 68 69 65 | 76 65 20 73 6f 6d 65 20 |er achie|ve some |
|000005a0| 73 65 6d 61 6e 74 69 63 | 0a 3e 20 77 68 69 63 68 |semantic|.> which|
|000005b0| 20 72 65 73 65 6d 62 6c | 65 73 20 74 68 65 20 2b | resembl|es the +|
|000005c0| 20 6f 70 65 72 61 74 6f | 72 2e 20 49 74 27 73 20 | operato|r. It's |
|000005d0| 6a 75 73 74 20 61 20 6d | 61 74 74 65 72 20 6f 66 |just a m|atter of|
|000005e0| 20 70 65 72 73 6f 6e 61 | 6c 20 74 61 73 74 65 2c | persona|l taste,|
|000005f0| 20 49 4d 48 4f 2e 0a 3e | 20 0a 3e 20 42 75 74 20 | IMHO..>| .> But |
|00000600| 69 66 20 6f 6e 65 20 69 | 73 20 72 65 61 6c 6c 79 |if one i|s really|
|00000610| 20 63 6f 6e 63 65 72 6e | 65 64 20 61 62 6f 75 74 | concern|ed about|
|00000620| 20 72 75 6e 74 69 6d 65 | 20 65 66 66 69 63 69 65 | runtime| efficie|
|00000630| 6e 63 79 2c 20 63 68 61 | 6e 63 65 73 20 61 72 65 |ncy, cha|nces are|
|00000640| 20 74 68 61 74 20 61 0a | 3e 20 32 2d 6f 70 65 72 | that a.|> 2-oper|
|00000650| 61 6e 64 20 6d 65 6d 62 | 65 72 20 66 75 6e 63 74 |and memb|er funct|
|00000660| 69 6f 6e 20 61 64 64 20 | 63 61 6e 20 62 65 20 77 |ion add |can be w|
|00000670| 72 69 74 74 65 6e 20 73 | 6f 20 69 74 20 69 73 20 |ritten s|o it is |
|00000680| 6d 6f 72 65 20 65 66 66 | 69 63 69 65 6e 74 20 74 |more eff|icient t|
|00000690| 68 61 6e 0a 3e 20 74 68 | 65 20 6f 70 65 72 61 74 |han.> th|e operat|
|000006a0| 6f 72 2b 3d 20 75 73 65 | 64 20 69 6e 20 74 68 65 |or+= use|d in the|
|000006b0| 20 77 61 79 20 64 65 73 | 63 72 69 62 65 64 20 61 | way des|cribed a|
|000006c0| 62 6f 76 65 2e 0a 0a 54 | 72 75 65 2c 20 73 79 6e |bove...T|rue, syn|
|000006d0| 74 61 78 20 69 73 20 61 | 20 6d 61 74 74 65 72 20 |tax is a| matter |
|000006e0| 6f 66 20 74 61 73 74 65 | 2e 20 20 42 75 74 20 66 |of taste|. But f|
|000006f0| 72 6f 6d 20 65 66 66 69 | 63 69 65 6e 63 79 20 70 |rom effi|ciency p|
|00000700| 6f 69 6e 74 20 6f 66 0a | 76 69 65 77 2c 20 49 27 |oint of.|view, I'|
|00000710| 76 65 20 61 6c 77 61 79 | 73 20 63 6f 6e 73 69 64 |ve alway|s consid|
|00000720| 65 72 65 64 20 72 65 66 | 65 72 65 6e 63 65 64 20 |ered ref|erenced |
|00000730| 62 61 73 65 64 20 6f 70 | 65 72 61 74 6f 72 73 20 |based op|erators |
|00000740| 73 75 70 65 72 69 6f 72 | 2e 0a 44 6f 20 79 6f 75 |superior|..Do you|
|00000750| 20 68 61 76 65 20 61 20 | 63 6f 75 6e 74 65 72 20 | have a |counter |
|00000760| 65 78 61 6d 70 6c 65 3f | 0a 0a 2d 2d 2d 20 4a 65 |example?|..--- Je|
|00000770| 61 6e 20 50 69 65 72 72 | 65 0a |an Pierr|e. |
+--------+-------------------------+-------------------------+--------+--------+